package com.xuecheng.teaching.controller;

import com.xuecheng.commons.model.dto.Comment2Dto;
import com.xuecheng.commons.model.dto.Comment3Dto;
import com.xuecheng.commons.model.dto.CommentDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import org.springframework.web.bind.annotation.*;
import com.xuecheng.teaching.service.CommentReplyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class CommentReplyController {

    @Autowired
    private CommentReplyService  commentReplyService;


    //课程评论回复
    @PostMapping("/course-comment-reply")
    public ResponseResult reply(@RequestBody Comment3Dto dto){
        return commentReplyService.reply(dto);
    }


    // 删除评论
    @DeleteMapping("/course-comment/{commentId}")
    public ResponseResult deleteByCommentId(@PathVariable("commentId") Integer commentId){
         return commentReplyService.deleteByCommentId(commentId);
    }
}
